<?php
/**
 * 上传
 */
class UploadAction {
	
	public function uploadImage() {
		import("ORG.Util.FileUpload");
		//import('ORG.Util.YImage');
		
		$savePath = date('Y/m', time());
		$up = new FileUpload(array('israndname'=>true, 'savepath'=>'./Upload/images/'.$savePath));
		$up->uploadFile('Filedata');
		if('' != $up->getErrorMsg()) {
			echo '_error ' . $up->getErrorMsg();
		} else {
			$f = $up->getUploadFileName();
			//$_dir = dirname($f);
			//$_basename = basename($f);
			//$img = new YImage($_dir);
			//$tb = $img->thumb($_basename, 150, 100);
			//echo $f . '|' . $_dir . '/' . $tb;  // 原图 | 缩略图
			echo $f;  // 原图
		}
	}
}